package com.ld.campus_help.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ld.campus_help.entity.Unused;
import com.ld.campus_help.service.UnusedService;
import com.ld.campus_help.mapper.UnusedMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author 10937
* @description 针对表【unused】的数据库操作Service实现
* @createDate 2023-08-24 18:52:25
*/
@Service
public class UnusedServiceImpl extends ServiceImpl<UnusedMapper, Unused>
    implements UnusedService{

    @Autowired
    private UnusedMapper unusedMapper;

    @Override
    public List<Unused> getList(int school_id) {
        QueryWrapper<Unused> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("school_id", school_id);
        return unusedMapper.selectList(queryWrapper);
    }

    @Override
    public List<Unused> getList(Unused unused) {
        QueryWrapper<Unused> queryWrapper = new QueryWrapper<>();
        queryWrapper.eq("school_id", unused.getSchoolId());
        queryWrapper.eq("status", unused.getStatus());
        return unusedMapper.selectList(queryWrapper);
    }
}




